
/**
 * 按钮
 */

import React, { Component } from 'react'

export default class MyButton extends Component {
  constructor(props) {
    super(props)
    this.state = {
    }
  }

  render() {
    let {
      onClick = () => {},
    } = this.props

    const {
      type = 'red',
      disabled = false,
    } = this.state


    let className = 'common-btn'

    if (type === 'red') {
      className += ' red-btn'
    } else if (type === 'white') {
      className += 'white-btn'
    }

    if (disabled) {
      className += ' disabled-btn'
      onClick = () => {}
    }
    return (
      <div className={className} onClick={onClick}>
        {this.props.children}
      </div>
    )
  }
}
